/**
 * localStorage存储封装
 * @type {{set: LocalStore.set, get: LocalStore.get, clear: LocalStore.clear, remove: LocalStore.remove}}
 */
export const LocalStore = {
    get: function (key) {
        let value = localStorage.getItem(key);
        if (value) {
            try {
                return JSON.parse(value);
            } catch (e) {
            }
        }
        return {}
    },
    set: function (key, value) {
        localStorage.setItem(key, value);
    },
    remove: function (key) {
        localStorage.removeItem(key);
    },
    clear: function () {
        localStorage.clear();
    }
};